Numerik Präsentation

Aufgabe 15 (Profil eines Flugzeugflügels)

Gian Ruchti

Aufgabenbeschreibung

Gegeben ist die Funktion:

\[ t(x) = 0.15 \cdot \left(3.8\sqrt{x} - 3.2x - 0.3x^4\right), \quad x \geq 0 \]

Diese beschreibt die Oberseite (halber Durchmesser) eines Flugzeugflügels, solange \(t(x) \geq 0\) gilt.

Aufgabenstellung:

  1. Bestimmen Sie die Flügelhinterkante \(x_{max}\)
  2. Berechnen Sie die maximale Profildicke \(t_{max}\) mit einer Genauigkeit von \(10^{-6}\) Wählen Sie jeweils sinnvolle Startwerte.

Graphische Darstellung

  1. Gesucht ist die Nullstelle der Funktion im positiven Bereich.
  2. Gesucht ist der x-Wert, bei dem die Steigung gleich null ist (lokales Extremum).

Newton-Verfahren – Iterationsformel

Das Newton-Verfahren basiert auf der Formel:

\[ x_{n+1} = x_n - \frac{t(x_n)}{t'(x_n)} \]

Dabei ist:

  • t(x)           : die Funktion, deren Nullstelle gesucht wird
  • t’(x)          : die Ableitung der Funktion
  • x_n           : aktuelle Näherung
  • x_{n+1}  : nächste Näherung

Ableitung

Die Funktion:

\[ t(x) = 0.15 \cdot \left(3.8\sqrt{x} - 3.2x - 0.3x^4\right) \]

Ihre erste Ableitung:

\[ t'(x) = 0.15 \cdot \left(\frac{3.8}{2\sqrt{x}} - 3.2 - 1.2x^3\right) \]

Wertetabelle zur Bestimmung des Startpunkts

|    x |      t(x) | Vorzeichen   |
|-----:|----------:|:-------------|
| 1    |  0.045    | +            |
| 1.05 |  0.025378 | +            |
| 1.1  |  0.003937 | +            |
| 1.15 | -0.019448 | -            |
| 1.2  | -0.044908 | -            |
| 1.25 | -0.072584 | -            |
| 1.3  | -0.102625 | -            |

Als Startwert => x0 = 1.1

Newton-Verfahren – Python-Code

import numpy as np
import pandas as pd

# Funktion t(x): beschreibt die halbe Dicke des Flügelprofils
def t(x):
    return 0.15 * (3.8 * np.sqrt(x) - 3.2 * x - 0.3 * x**4)

# Erste Ableitung t'(x): notwendig für das Newton-Verfahren
def dt(x):
    return 0.15 * (3.8 / (2 * np.sqrt(x)) - 3.2 - 1.2 * x**3)

# Startwert für das Newton-Verfahren
x0 = 1.1

# Abbruchkriterium (Toleranz)
tol = 1e-6

# Maximale Anzahl an Iterationen
max_iter = 20

# Liste zur Speicherung der Iterationsergebnisse
data = []

# Newton-Verfahren zur Bestimmung der Nullstelle von t(x)
for i in range(max_iter):
    f_val = t(x0)          # Funktionswert an der aktuellen Stelle
    df_val = dt(x0)        # Ableitungswert an der aktuellen Stelle
    x1 = x0 - f_val / df_val  # Newton-Schritt
    dx = abs(x1 - x0)      # Änderung zum vorherigen Wert
    data.append([i, round(x0, 6), round(f_val, 6), f"{dx:.2e}"])
    if dx < tol:           # Abbruchbedingung erfüllt?
        break
    x0 = x1                # Nächste Iteration

# Ergebnis auf 6 Nachkommastellen runden
x_result = round(x1, 6)
t_result = round(t(x_result), 6)

# Ergebnisse als DataFrame formatieren
df_result = pd.DataFrame(data, columns=["Iter", "x_n", "t(x_n)", "Δx"])

Ergebnis des Newton-Verfahrens

|   Iter |     x_n |    t(x_n) |       Δx |
|-------:|--------:|----------:|---------:|
|      0 | 1.1     |  0.003937 | 0.00879  |
|      1 | 1.10879 | -3e-05    | 6.63e-05 |
|      2 | 1.10872 | -0        | 3.79e-09 |

x_max ≈ 1.108724
t(x_max) ≈ -0.0

Bisektionsverfahren zur Bestimmung des Maximums

import numpy as np
import pandas as pd

# Funktionen definieren (Originalfunktion t(x) und deren Ableitung t'(x))
def dt(x):
    # Erste Ableitung von t(x), notwendig zur Bestimmung von Extrempunkten
    return 0.15 * (3.8 / (2 * np.sqrt(x)) - 3.2 - 1.2 * x**3)

def t(x):
    # Originalfunktion: beschreibt die halbe Dicke des Flügelprofils
    return 0.15 * (3.8 * np.sqrt(x) - 3.2 * x - 0.3 * x**4)

# Anfangsintervall für die Bisektion
a, b = 0.001, 1.108

# Abbruchkriterien
tol = 1e-6
max_iter = 50

# Liste zur Speicherung der Iterationsschritte
data_bisektion = []

# Bisection-Verfahren zur Nullstellenbestimmung von dt(x)
for i in range(max_iter):
    xm = (a + b) / 2          # Mittelpunkt des aktuellen Intervalls
    fa = dt(a)                # Funktionswert am linken Rand
    fxm = dt(xm)              # Funktionswert am Mittelpunkt

    # Iterationsdaten speichern: Iteration, Intervallgrenzen, xm, f(xm), Intervallbreite
    data_bisektion.append([
        i,
        round(a, 6),
        round(b, 6),
        round(xm, 6),
        round(fxm, 6),
        f"{abs(b - a):.2e}"
    ])

    # Abbruchbedingung prüfen
    if abs(fxm) < tol or abs(b - a) < tol:
        break

    # Intervallhalbierung basierend auf Vorzeichenwechsel
    if fa * fxm < 0:
        b = xm
    else:
        a = xm

Ergebnis der Bisektion – Maximale Dicke

|   Iter |        a |        b |      x_m |   t'(x_m) |   Δ(b - a) |
|-------:|---------:|---------:|---------:|----------:|-----------:|
|      0 | 0.001    | 1.108    | 0.5545   | -0.127957 |   1.11     |
|      1 | 0.001    | 0.5545   | 0.27775  |  0.05692  |   0.553    |
|      2 | 0.27775  | 0.5545   | 0.416125 | -0.051163 |   0.277    |
|      3 | 0.27775  | 0.416125 | 0.346938 | -0.003657 |   0.138    |
|      4 | 0.27775  | 0.346938 | 0.312344 |  0.024466 |   0.0692   |
|      5 | 0.312344 | 0.346938 | 0.329641 |  0.009944 |   0.0346   |
|      6 | 0.329641 | 0.346938 | 0.338289 |  0.003037 |   0.0173   |
|      7 | 0.338289 | 0.346938 | 0.342613 | -0.000336 |   0.00865  |
|      8 | 0.338289 | 0.342613 | 0.340451 |  0.001344 |   0.00432  |
|      9 | 0.340451 | 0.342613 | 0.341532 |  0.000503 |   0.00216  |
|     10 | 0.341532 | 0.342613 | 0.342073 |  8.3e-05  |   0.00108  |
|     11 | 0.342073 | 0.342613 | 0.342343 | -0.000126 |   0.000541 |
|     12 | 0.342073 | 0.342343 | 0.342208 | -2.2e-05  |   0.00027  |
|     13 | 0.342073 | 0.342208 | 0.34214  |  3.1e-05  |   0.000135 |
|     14 | 0.34214  | 0.342208 | 0.342174 |  4e-06    |   6.76e-05 |
|     15 | 0.342174 | 0.342208 | 0.342191 | -9e-06    |   3.38e-05 |
|     16 | 0.342174 | 0.342191 | 0.342183 | -2e-06    |   1.69e-05 |
|     17 | 0.342174 | 0.342183 | 0.342178 |  1e-06    |   8.45e-06 |
|     18 | 0.342178 | 0.342183 | 0.34218  | -0        |   4.22e-06 |

Endergebnis:
x_max ≈ 0.34218
Maximale Dicke t_max ≈ 0.168565

Verifikation des Ergebnisses

Danke für Ihre Aufmerksamkeit 🙏

Bei Fragen zur Aufgabe stehe ich gerne zur Verfügung. 💬

Präsi: github.com/RUCG/numeric_presentation